//SPDX-FileCopyrightText: Copyright 2022-2024 深圳市同心圆网络有限公司
//SPDX-License-Identifier: GPL-3.0-only

package impl

import (
	"sync"

	"github.com/dchest/uniuri"
	"github.com/pkg/sftp"
)

type UsernameAndAddr struct {
	Username string
	Addr     string
}

type ClientInfo struct {
	Name         string
	AuthInfoList []UsernameAndAddr
	client       *ChainClient
	sftpClient   *sftp.Client
	forwardMap   sync.Map
	shellMap     sync.Map
	shellIndex   int32
}

var clientMap = sync.Map{}
var token string

func Init() string {
	token = uniuri.NewLenChars(64, []byte("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"))
	return token
}
